#pragma once
#ifndef __MATERIAL__EDITOR_WIDGET__HH__
#define __MATERIAL__EDITOR_WIDGET__HH__

#include "MaterialTextEdit.h"
#include <qtoolbar.h>
#include <qicon.h>

namespace Lit
{
	namespace Editor
	{
		namespace Material
		{
			class EditorWidget : public QWidget
			{
				Q_OBJECT
			protected:
				struct Ui
				{
					struct UiActions
					{
						UiActions();
						~UiActions();
					};
					Ui();
					~Ui();

					QVBoxLayout*		layout;
					TextEdit *			textEdit;
					QToolBar *			toolBar;
				
					void setupUi( QWidget * w );
					void connectUi(QWidget * w);
					void setupToolbar( QWidget * w );
					
					UiActions actions;
				};

				Ui ui;
			public:
				EditorWidget( QWidget * parent ) ;
				~EditorWidget();
			
				Ui* getUi();
				const Ui* getUi() const;

				void setText( const std::string &txt );
				std::string getText() const;

				void setModified( bool state );
				bool isModified() const;

			signals:
				void modifiedStateChanged(bool state);
			};
		};
	};
};

#endif